package com.example.mapper;

import com.example.domain.ImageRecord;
import com.example.domain.User;
import com.example.domain.dto.ChatMessageDto;
import com.example.domain.vo.ChatMessageVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AIToolMapper {
    int addDialogue(ChatMessageDto chatMessageDto);

    List<ChatMessageVo> getDialogueById(Long userId, String title);

    List<ChatMessageVo> getDialogueByDialogueId(Long dialogueId);

    int addChatMessage(ChatMessageDto chatMessageDto);

    int deleteDialogue(Long dialogueId);

    void deleteChatMessage(Long dialogueId);

    User getUserById(Long id);

    @Insert("insert into chat_image (image_url,description,create_user) values (#{imageUrl},#{description},#{createUser})")
    void insert(ImageRecord record);

    @Select("select * from chat_image where create_user = #{userId}")
    List<ImageRecord> imagList(Integer userId);

    @Delete("delete from chat_image where id = #{imageUrl}")
    void removeImage(Integer imageUrl);
}
